/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.h2t.loveplace.views;

import com.h2t.loveplace.main.LoveplaceMidlet;
import com.h2t.loveplace.views.components.Map;
import com.sun.lwuit.Command;
import com.sun.lwuit.Form;
import com.sun.lwuit.events.ActionEvent;
import com.sun.lwuit.events.ActionListener;
import com.sun.lwuit.layouts.BorderLayout;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Displayable;

/**
 *
 * @author PHAN THAI
 */
public class MapView extends Form implements ActionListener {

    private Map map;
    private LoveplaceMidlet midlet;
    private Command cmdBack;

    public MapView(LoveplaceMidlet midlet, Map map) {
        this.midlet = midlet;
        this.map = map;
        setLayout(new BorderLayout());
        addComponent(BorderLayout.CENTER, map);

        cmdBack = new Command("Back");
        setBackCommand(cmdBack);
        addCommand(cmdBack);
        addCommandListener(this);
    }
    

    public void actionPerformed(ActionEvent ae) {
        if (ae.getCommand() == cmdBack) {
           // midlet.getViewDetaiPlace().setPlace(map.getPlace());
            midlet.currentPlace = map.getPlace();
            midlet.showDetailPlaceView();
        }
    }
}
